package wzc.design_pattern.behaviour.chain;

/**
 * @Author 那和不是个啥
 * @Date 2025/7/20
 * @Description
 */

public class ChainOfResponsibilityDemo {
    public static void main(String[] args) {
        // 创建处理者
        LeaveHandler manager = new Manager();
        LeaveHandler director = new Director();
        LeaveHandler ceo = new CEO();

        manager.setNextHandler(director);
        director.setNextHandler(ceo);

        // 发起请假流程
        System.out.println("员工请假 2 天------");
        manager.handleRequest(2);

        System.out.println("员工请假 5 天------");
        manager.handleRequest(5);

        System.out.println("员工请假 10 天------");
        manager.handleRequest(10);
    }
}
